<template>
  <div id="safe">
    <div class="header">
      <Header :name="name"></Header>
    </div>
    <div class="main">
      <li v-for="item in safe" :key="item.name">
        <span>{{ item.name }}</span>
        <van-switch
          v-model="item.checked"
          active-color="#f6bb18"
          inactive-color="#dcdee0"
        />
      </li>
      <li>
        <span>微信身份验证</span>
        <van-icon name="arrow" />
      </li>
    </div>
    <button class="geng">更改密码</button>
  </div>
</template>

<script setup>
import { ref, reactive } from "vue";
import Header from "./Header.vue";
import { useRoute } from "vue-router";

const route = useRoute();
const name = route.query.name;
console.log(name);

const safe = reactive([
  {
    name: "记住密码",
    checked: true,
  },
  {
    name: "人脸识别",
    checked: true,
  },
  {
    name: "生物识别ID",
    checked: true,
  },
]);
</script>

<style scoped>
* {
  margin: 0;
  padding: 0;
}
#safe {
  width: 100%;
  height: 100%;
}

.main {
  width: 90%;
  border: 1px solid #ccc;
  border-radius: 1rem;
  margin-left: 5%;
  margin-top: 5%;
}

.main li {
  list-style: none;
  width: 90%;
  margin-left: 5%;
  height: 4rem;
  line-height: 4rem;
  border-bottom: 2px solid #ccc;
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
}

.main li:last-child {
  border-bottom: none;
}

.van-switch {
  margin-top: 1.2rem;
}

.van-icon {
  font-size: 1.5rem;
  margin-top: 1.2rem;
}

.geng {
  width: 90%;
  height: 4rem;
  border-radius: 1rem;
  background-color: #f6bb18;
  color: #fff;
  font-size: 1.2rem;
  border: none;
  margin-left: 5%;
  margin-top: 2rem;
}
</style>